using System.IO;
using System.Reflection;

namespace TLDRMLTests
{
    public static class AssemblyExtensions
    {
        public static string LoadResource(this Assembly assembly, string name)
        {
            string text;

            using (var stream = assembly.GetManifestResourceStream(name))
            using (var reader = new StreamReader(stream))
                text = reader.ReadToEnd();

            return text;
        }
    }
}